﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZSZ.Service.Entity;

namespace ZSZ.Service.EntityConfig
{
    class HouseAppointmentConfig: EntityTypeConfiguration<HouseAppointmentEntity>
    {
        public HouseAppointmentConfig() {
            this.ToTable("T_HouseAppointment");
            this.HasOptional(h => h.User).WithMany().HasForeignKey(h=>h.UserId);
            this.HasRequired(h => h.House).WithMany().HasForeignKey(h=>h.HouseId);
            this.HasOptional(h=>h.AdminUser).WithMany().HasForeignKey(h=>h.FollowAdminUserId);
            this.Property(h => h.Hei).IsRowVersion();
        }
    }
}
